This specification relates to testing source code.
Source code is typically maintained by developers in a code base of source code using a version control system. Version control systems generally maintain multiple revisions of the source code in the code base, each revision being referred to as a snapshot. Each snapshot includes the source code of files of the code base as the files existed at a particular point in time.
Snapshots stored in a version control system can be represented as a directed, acyclical revision graph. Each node in the revision graph represents a commit of the source code. A commit represents a snapshot as well as other pertinent information about the snapshot such as the author of the snapshot, and data about ancestor commits of the node in the revision graph. A directed edge from a first node to a second node in the revision graph indicates that a commit represented by the first node is a previous commit than a commit represented by the second node, and that no intervening commits exist in the version control system.
A common approach to software testing is to require that a commit passes a suite of testing functions before the snapshot is merged into the code base. For large software projects with comprehensive test suites, running tests can take many hours. In many cases, a single test failure is sufficient to bar a commit from merging. Thus, when a test fails, all the time spent running the previous tests was time wasted. In other words, if the failing test had been run first, none of the other tests would have been required to run.